<style>
    .welcome .layui-card {border:1px solid #f2f2f2;border-radius:5px;}
    .welcome .icon {margin-right:10px;color:#1aa094;}
    .welcome .icon-cray {color:#ffb800 !important;}
    .welcome .icon-blue {color:#1e9fff !important;}
    .welcome .icon-tip {color:#ff5722 !important;}
    .welcome .layuimini-qiuck-module {text-align:center;margin-top:10px}
    .welcome .layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
    .welcome .layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
    .welcome .welcome-module {width:100%;height:210px;}
    .welcome .panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}
    .welcome .panel-body {padding:10px}
    .welcome .panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit}
    .welcome .label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top:.3em;}
    .welcome .layui-red {color:red}
    .welcome .main_btn > p {height:40px;}
    .welcome .layui-bg-number {background-color:#F8F8F8;}
    .welcome .layuimini-notice:hover {background:#f6f6f6;}
    .welcome .layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
    .welcome .layuimini-notice-title,.layuimini-notice-label {padding-right:0 !important;text-overflow:ellipsis !important;overflow:hidden !important;white-space:nowrap !important;}
    .welcome .layuimini-notice-title {line-height:28px;font-size:14px;}
    .welcome .layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
</style>
<div id="consoleVue" class="layuimini-container layui-anim layui-anim-upbit" xmlns:v-bind="http://www.w3.org/1999/xhtml">
    <div class="layuimini-main welcome">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md8">
                <div class="layui-row layui-col-space15">

                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-warning icon"></i>基本数据统计</div>
                            <div class="layui-card-body">
                                <i v-if="spaceModelList.length == 0" class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 26px;"></i>
                                <div class="welcome-module">
                                    <div class="layui-row layui-col-space10">
                                        <div v-for="(item, index) in modelList" :key="item.id" class="layui-col-xs6">
                                            <div class="panel layui-bg-number">
                                                <div class="panel-body">
                                                    <div class="panel-title">
                                                        <span v-bind:class="item.doneClass" v-html="item.done">***</span>
                                                        <h5 v-html="item.title">***</h5>
                                                    </div>
                                                    <div class="panel-content">
                                                        <h1 class="no-margins" v-html="item.num">***</h1>
                                                        <small v-html="item.remark">***</small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-warning icon"></i>空间数据统计模块</div>
                            <div class="layui-card-body">
                                <i v-if="spaceModelList.length == 0" class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 26px;"></i>
                                <div class="welcome-module">
                                    <div class="layui-row layui-col-space10">
                                        <div v-for="(item, index) in spaceModelList" :key="item.id" class="layui-col-xs6">
                                            <div class="panel layui-bg-number">
                                                <div class="panel-body">
                                                    <div class="panel-title">
                                                        <span v-bind:class="item.doneClass" v-html="item.done">***</span>
                                                        <h5 v-html="item.title">***</h5>
                                                    </div>
                                                    <div class="panel-content">
                                                        <h1 class="no-margins" v-html="item.num">***</h1>
                                                        <small v-html="item.remark">***</small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

<!--                    <div class="layui-col-md6">-->
<!--                        <div class="layui-card">-->
<!--                            <div class="layui-card-header"><i class="fa fa-credit-card icon icon-blue"></i>快捷入口</div>-->
<!--                            <div class="layui-card-body">-->
<!--                                <div class="welcome-module">-->
<!--                                    <div class="layui-row layui-col-space10 layuimini-qiuck">-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/menu.html" data-title="菜单管理" data-icon="fa fa-window-maximize">-->
<!--                                                <i class="fa fa-window-maximize"></i>-->
<!--                                                <cite>菜单管理</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/setting.html" data-title="系统设置" data-icon="fa fa-gears">-->
<!--                                                <i class="fa fa-gears"></i>-->
<!--                                                <cite>系统设置</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/table.html" data-title="表格示例" data-icon="fa fa-file-text">-->
<!--                                                <i class="fa fa-file-text"></i>-->
<!--                                                <cite>表格示例</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/icon.html" data-title="图标列表" data-icon="fa fa-dot-circle-o">-->
<!--                                                <i class="fa fa-dot-circle-o"></i>-->
<!--                                                <cite>图标列表</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/form.html" data-title="表单示例" data-icon="fa fa-calendar">-->
<!--                                                <i class="fa fa-calendar"></i>-->
<!--                                                <cite>表单示例</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/404.html" data-title="404页面" data-icon="fa fa-hourglass-end">-->
<!--                                                <i class="fa fa-hourglass-end"></i>-->
<!--                                                <cite>404页面</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/button.html" data-title="按钮示例" data-icon="fa fa-snowflake-o">-->
<!--                                                <i class="fa fa-snowflake-o"></i>-->
<!--                                                <cite>按钮示例</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                        <div class="layui-col-xs3 layuimini-qiuck-module">-->
<!--                                            <a href="javascript:;" data-content-href="page/layer.html" data-title="弹出层" data-icon="fa fa-shield">-->
<!--                                                <i class="fa fa-shield"></i>-->
<!--                                                <cite>弹出层</cite>-->
<!--                                            </a>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->
                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-line-chart icon"></i>报表统计</div>
                            <div class="layui-card-body">
                                <div id="echarts-records" style="width: 100%;min-height:500px"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-col-md4">

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-bullhorn icon icon-tip"></i>最近点赞记录</div>
                    <div class="layui-card-body layui-text">
                        <i v-if="praiseModelList.length == 0" class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 26px;"></i>
                        <div v-for="(item, index) in praiseModelList" :key="item.id" class="layuimini-notice">
                            <div class="layuimini-notice-title" v-html="item.title" style="width:65%"></div>
                            <div class="layuimini-notice-extra" v-html="item.time" style="width:35%;text-align: right;"></div>
                            <div class="layuimini-notice-content layui-hide">
                                {{item.title}}
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-fire icon"></i>版本信息</div>
                    <div class="layui-card-body layui-text">
                        <table class="layui-table">
                            <colgroup>
                                <col width="100">
                                <col>
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>框架名称</td>
                                <td>
                                    layuimini
                                </td>
                            </tr>
                            <tr>
                                <td>当前版本</td>
                                <td>v1.0.4</td>
                            </tr>
                            <tr>
                                <td>主要特色</td>
                                <td>零门槛 / 响应式 / 清爽 / 极简</td>
                            </tr>
                            <tr>
                                <td>演示地址</td>
                                <td>
                                    iframe版：<a href="http://layuimini.99php.cn/" target="_blank">点击查看</a><br>
                                    单页版：<a href="http://layuimini-onepage.99php.cn" target="_blank">点击查看</a>
                                </td>
                            </tr>
                            <tr>
                                <td>下载地址</td>
                                <td>
                                    iframe版：<a href="" target="_blank">github</a> / <a href="" target="_blank">gitee</a><br>
                                    单页版：<a href="" target="_blank">github</a> / <a href="" target="_blank">gitee</a>
                                </td>
                            </tr>
                            <tr>
                                <td>Gitee</td>
                                <td style="padding-bottom: 0;">
                                    <div class="layui-btn-container">
                                        <a href="" target="_blank" style="margin-right: 15px"><img src="" alt="star"></a>
                                        <a href="" target="_blank"><img src="" alt="fork"></a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>Github</td>
                                <td style="padding-bottom: 0;">
                                    <div class="layui-btn-container">
                                        <iframe src="" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
                                        <iframe src="" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-paper-plane-o icon"></i>作者心语</div>
                    <div class="layui-card-body layui-text layadmin-text">
                        <p>本模板基于layui2.5.4以及font-awesome-4.7.0进行实现。layui开发文档地址：<a class="layui-btn layui-btn-xs layui-btn-danger" target="_blank" href="http://www.layui.com/doc">layui文档</a></p>
                        <p>技术交流QQ群（561838086）：<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=5JRGVfe"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="layuimini" title="layuimini"></a>（加群请备注来源：如gitee、github、官网等）</p>
                        <p>喜欢此后台模板的可以给我的GitHub和Gitee加个Star支持一下</p>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/layuimini/js/jquery.min.js"></script>
<script type="text/javascript" src="/web/webIndex/console.js"></script>
<script type="text/javascript" src="/layuimini/js/vue.min.js"></script>
<script type="text/javascript">
    var consoleVue = new Vue({
        el: '#consoleVue',
        data: function () {
            return {
                modelList: [], //基本数据统计模块
                spaceModelList: [], //空间数据统计模块
                praiseModelList: [] //点赞记录模块
            }
        },
        created: function () {
            const me = this;
            me.$nextTick(function () {
                me.getDataStaticModel();
                me.getSpaceDataStaticModel();
                me.getPraiseStaticModel();
            });
        },
        methods: {
            //初始化基本数据统计模块
            getDataStaticModel: function () {
                const me = this;
                $.ajax({
                    type: 'POST',
                    url: '/web/webIndex/getDataStaticModel',
                    data: {},
                    dataType: 'JSON',
                    success: function (data) {
                        if (data.state == "200") {
                            me.modelList = data.modelList;
                        } else {
                            layui.use('layer', function () {
                                var layer = layui.layer;
                                layer.msg(data.message, {icon: 2});
                            });
                        }
                    },
                    error: function (error) {
                        layui.use('layer', function () {
                            var layer = layui.layer;
                            layer.msg(error, {icon: 2});
                        });
                    }
                })
            },

            //初始化空间数据统计模块
            getSpaceDataStaticModel: function () {
                const me = this;
                $.ajax({
                    type: 'POST',
                    url: '/web/webIndex/getSpaceDataStaticModel',
                    data: {},
                    dataType: 'JSON',
                    success: function (data) {
                        if (data.state == "200") {
                            me.spaceModelList = data.spaceModelList;
                        } else {
                            layui.use('layer', function () {
                                var layer = layui.layer;
                                layer.msg(data.message, {icon: 2});
                            });
                        }
                    },
                    error: function (error) {
                        layui.use('layer', function () {
                            var layer = layui.layer;
                            layer.msg(error, {icon: 2});
                        });
                    }
                })
            },

            //初始化点赞记录模块
            getPraiseStaticModel: function () {
                const me = this;
                $.ajax({
                    type: 'POST',
                    url: '/web/webIndex/getPraiseStaticModel',
                    data: {},
                    dataType: 'JSON',
                    success: function (data) {
                        if (data.state == "200") {
                            me.praiseModelList = data.praiseModelList;
                        } else {
                            layui.use('layer', function () {
                                var layer = layui.layer;
                                layer.msg(data.message, {icon: 2});
                            });
                        }
                    },
                    error: function (error) {
                        layui.use('layer', function () {
                            var layer = layui.layer;
                            layer.msg(error, {icon: 2});
                        });
                    }
                })
            }
        }
    });
</script>
